<template>
	<view class="content">
		<view class="con_nav">
			<u-navbar is-back="false" border="false">
				<view class="nav_con" @click="cshow">
					<view>{{plantTitle}}</view>
					<view class="nav_icon">
						<u-icon name="arrow-right" color="#ffffff" size="24"></u-icon>
					</view>
				</view>
			</u-navbar>
		</view>
		<view class="devices">
			<view class="dev_snum">
				正常 23 | 故障 3 | 带病运行 0
			</view>
			<view class="dev_referral">
				<view class="ref_item">
					<view class="">
						<image class="maxiconSize" src="@/static/device/wxjinyong.png" mode=""></image>
					</view>
					<view class="item_tle">
						禁用
					</view>
					<view class="">
						2
					</view>
				</view>
				<view class="ref_item">
					<view class="">
						<image class="maxiconSize" src="@/static/device/wxxianzhi.png" mode=""></image>
					</view>
					<view class="item_tle">
						闲置
					</view>
					<view class="">
						2
					</view>
				</view>
				<view class="ref_item">
					<view class="">
						<image class="maxiconSize" src="@/static/device/wxbaofei.png" mode=""></image>
					</view>
					<view class="item_tle">
						报废
					</view>
					<view class="">
						2
					</view>
				</view>
				<view class="ref_item">
					<view class="">
						<image class="maxiconSize" src="@/static/device/wxpaimai.png" mode=""></image>
					</view>
					<view class="item_tle">
						变卖
					</view>
					<view class="">
						2
					</view>
				</view>
				<view class="ref_line">

				</view>
				<view class="ref_item">
					<view class="">
						<image class="maxiconSize" src="@/static/device/wxduoyingyong.png" mode=""></image>
					</view>
					<view class="item_tle">
						其他
					</view>
					<view class="">
						2
					</view>
				</view>
			</view>
			<view class="dev_status" @click="cshow">
				<view class="dev_use">
					<image class="maxiconSize" src="@/static/device/wxzhengchangshiyong.svg" mode=""></image> 设备总数: 666
				</view>
				<view class="">
					>
				</view>
			</view>
			<view class="dev_down">
				<image src="@/static/device/g-ningmeng.svg" mode=""></image>
				<text>设备列表 | 向下滑动显示更多 </text>
			</view>
		</view>
		<view class="dev_list" v-if="true">
			<mescroll-body class="water_scroll" ref="mescrollRef" @init="mescrollInit" :down="downOption"
				@down="downCallback" @up="upCallback">
				<view class="dev_item" v-for="item in 20" :key="item" @click="navTo('/pages/device/info')">
					<view class="intro">
						<view class="in_tle">F300前准备部分 | DEV2021000191</view>
						<view class="in_size"><text>规格型号：</text>FYF-200RE-1022</view>
						<view class="in_size"><text>负责人：</text>王阳明</view>
						<view class="in_status"><text class="so">C(一般)</text><text class="matter">B(重要)</text><text
								class="master">A(关键)</text><text class="very">特</text>
							<image src="@/static/navigation/维保 (2).png" mode=""></image>
						</view>
					</view>
					<view class="img">
						<image src="@/static/device/shebei.png" mode=""></image>
						</view>
			</view>
			</mescroll-body>
		</view>
		<view v-if="false" class="dev_func">
			<view class="func_item">
				<DevTitle oneTle="设备台账" twoTle="设备台账"></DevTitle>
				<view class="func_list">
					<view class="list_item" @click="navTo('/pages/device/list')">
						<view class="">
							<image src="@/static/device/wxliebiao1.svg" mode=""></image>
						</view>
						<view class="">
							设备列表
						</view>
					</view>
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxliebiao.svg" mode=""></image>
						</view>
						<view class="">
							设备盘点
						</view>
					</view>
				</view>
			</view>
			<view class="func_item">
				<DevTitle oneTle="购置管理" twoTle="设备采购管理"></DevTitle>
				<view class="func_list">
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxliebiao.svg" mode=""></image>
						</view>
						<view class="">
							采购计划
						</view>
					</view>
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxxianxinggouwudai.svg" mode=""></image>
						</view>
						<view class="">
							采购申请
						</view>
					</view>
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxyanshoutongguo.svg" mode=""></image>
						</view>
						<view class="">
							设备验收
						</view>
					</view>
				</view>
			</view>
			<view class="func_item">
				<DevTitle oneTle="设备处置" twoTle="设备管理"></DevTitle>
				<view class="func_list">
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxtiaobozhuanyi.svg" mode=""></image>
						</view>
						<view class="">
							调拨转移
						</view>
					</view>
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxshebeichuzhi.svg" mode=""></image>
						</view>
						<view class="">
							设备处置
						</view>
					</view>
					<view class="list_item">
						<view class="">
							<image src="@/static/device/wxpaimai1.svg" mode=""></image>
						</view>
						<view class="">
							设备变卖
						</view>
					</view>
					<view class="list_item" style="margin-right: 0;">
						<view class="">
							<image src="@/static/device/wxlingyongguihuan.svg" mode=""></image>
						</view>
						<view class="">
							领用归还
						</view>
					</view>
				</view>
			</view>
		</view>
		<u-select value-name="value" cancel-color="#999999" confirm-color="#0581fd" label-name="label" v-model="show" :list="list"
		 @confirm="confirm"></u-select>
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	import DevTitle from "@/components/dev-title/index.vue"
	export default {
		mixins: [MescrollMixin], // 使用mixin
		components:{DevTitle},
		data() {
			return {
				show: false,
				list: [{
						value: '1',
						label: '江'
					},
					{
						value: '2',
						label: '湖'
					}
				],
				downOption: {
					auto: false //是否在初始化后,自动执行downCallback; 默认true
				},
				plantTitle: '格物重庆超级工厂',
				background: '#0581fd'
			};
		},
		mounted() {},
		methods: {
			cshow() {
				console.log('001')
				this.show = true
			},

			confirm(e) {
				console.log(e)
			},
			/*下拉刷新的回调 */
			downCallback() {
				let that = this
				return
				//联网加载数据
				this.apis.materialsApi.maMaterialList({
					pageNum: 1,
					pageSize: 10,
					category: this.dictValue,
					materialName: this.materialName
				}).then(res => {
					this.materList = res.rows
					this.mescroll.endBySize(res.rows.length, res.total)
				}).catch(() => {
					//联网失败的回调,隐藏下拉刷新的状态
					this.mescroll.endErr();
				})
			},
			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
			upCallback(page) {
				//联网加载数据
				return
				this.apis.materialsApi.maMaterialList({
					pageNum: 1,
					pageSize: 10,
					category: this.dictValue,
					materialName: this.materialName
				}).then(res => {
					this.materList = this.materList.concat(res.rows);
					this.mescroll.endBySize(res.rows.length, res.total)

				}).catch(() => {
					//联网失败的回调,隐藏下拉刷新的状态
					this.mescroll.endErr();
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@mixin minIconSize{
		width: 40rpx;
		height: 40rpx;
	}
	@mixin maxIconSize{
		width: 60rpx;
		height: 60rpx;
	}
	/deep/ .u-navbar {
		background: $bodyColor !important;
		color: #FFFFFF !important;
	}

	/deep/ .u-back-wrap {

		padding: 0 30rpx 0 0 !important;
	}

	.content {
		/deep/ .u-iconfont {
			display: none !important;
		}

		background: #fafafa;
		position: relative;

		.con_nav{
			/deep/ .u-border-bottom:after{
				border: none;
			}
		}
		.nav_con {
			width: 100%;
			display: flex;
			align-items: center;

			/deep/ .u-iconfont {
				display: block !important;
			}

			.nav_icon {
				margin-left: 10rpx;
			}
		}
		.devices {
			z-index: 9;
			width: 100%;
			position: fixed;
			background-color: $bodyColor;
			box-sizing: border-box;
			padding: 0 30rpx;

			.dev_snum {
				font-size: 24rpx;
				color: #FFFFFF;
			}

			.dev_referral {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 60rpx 0;

				.ref_item {
					color: #FFFFFF;
					display: flex;
					flex-direction: column;
					align-items: center;
					font-size: 32rpx;

					image {
						@include minIconSize;
						font-size: blod;
					}

					.item_tle {
						font-size: 24rpx;
						margin: 6rpx 0;
					}
				}

				.ref_line {
					height: 130rpx;
					width: 2rpx;
					background: rgba($color: #ffffff, $alpha: 0.8);
				}
			}

			.dev_status {
				width: 92%;
				position: fixed;
				margin-top: -35rpx;
				@include box_shadow;
				@include box_radius(80rpx)
				color: $bodyColor;
				background: #ffffff;
				padding: 18rpx 30rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;
				justify-content: space-between;
				z-index: 9;

				.dev_use {
					font-size: 28rpx;
					display: flex;
					align-items: center;

					image {
						@include minIconSize;
						margin-right: 20rpx;
					}
				}
			}
		}
		.dev_list {
			overflow: hidden;
			box-sizing: border-box;
			padding: 0 20rpx;
			padding-top: 400rpx;
			display: flex;
			flex-direction: column;
		
			.dev_item {
				z-index: -1;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-radius: 24rpx;
				background: #FFFFFF;
				box-sizing: border-box;
				padding: 10rpx 0rpx 0rpx 20rpx;
				margin-bottom: 20rpx;
		
				image {
					width: 200rpx;
					height: 200rpx;
				}
		
				.intro {
					view {
						margin-bottom: 18rpx;
					}
		
					.in_tle {
						font-size: 28rpx;
						color: $bodyColor;
					}
		
					.in_size {
						font-size: 24rpx;
						color: #101010;
		
						text {
							color: #AEAEAE;
						}
					}
		
					.in_status {
						display: flex;
						align-items: center;
		
						text {
							font-size: 24rpx;
							display: inline-block;
							border-radius: 4rpx;
							background: #5FB878;
							padding: 2rpx;
							color: #FFFFFF;
							margin-right: 10rpx;
						}
		
						// 一般
						.so {
							background: #5FB878;
						}
		
						// 重要
						.matter {
							background: #813edb;
						}
		
						// 关键
						.master {
							background: #ff5722;
						}
		
						// 在用
						.use {
							background: #78bf34;
						}
		
						// 正常
						.normo {
							background: #358aef;
						}
		
						// 闲置
						.idle {
							background: #4abf94;
						}
		
						// 故障
						.fault {
							background: #e83672;
						}
		
						// 禁用
						.disable {
							background: #9da1a7;
						}
		
						// 带病运行
						.spite {
							background: #f0ad4e;
						}
		
						// 出租
						.out {
							background: #42b1e8;
						}
		
						image {
							@include miniIconSize;
						}
		
						.very {
							background: #FC8FA0;
							width: 36rpx;
							height: 36rpx;
							// padding: 2rpx;
							border-radius: 18rpx;
							text-align: center;
							line-height: 30rpx;
						}
					}
				}
			}
		}
		.dev_func{
			overflow: hidden;
			box-sizing: border-box;
			padding: 0 20rpx;
			padding-top: 370rpx;
			.func_item{
				display: flex;
				flex-direction: column;
				z-index: -1;
				@include box_radius(24rpx)
				background: #FFFFFF;
				box-sizing: border-box;
				padding: 30rpx 20rpx 50rpx 20rpx;
				margin-bottom: 30rpx;
				.func_tle{
					display: flex;
					justify-content: flex-start;
					align-items: center;
					margin-bottom: 48rpx;
					.tle_b{
							font-size: 32rpx;
							color: #333333;
							margin-left: -10rpx;
					}
					.tle_c{
						margin-left: 12rpx;
						font-size: 24rpx;
						color:#999999;
					}
					.tle_a{
						display: flex;
						align-items: center;
						image{
							@include minIconSize;
						}
					}
				}
				.func_list{
					display: flex;
					justify-content: flex-start;
					align-items: center;
					padding-left: 40rpx;
					.list_item{
						font-size: 24rpx;
						display: flex;
						flex-direction: column;
						align-items: center;
						margin-right: 70rpx;
					}
					image{
						@include maxIconSize;
					}
				}
			}
		}
		
		.dev_down {
			z-index: 8;
			width: 100%;
			position: absolute;
			display: flex;
			align-items: center;
			font-size: 24rpx;
			background: #f9f9f9;
			color: #AEAEAE;
			padding: 50rpx 20rpx 0rpx 0rpx;
			margin-left: -10rpx;
		
			image {
				@include maxIconSize;
				margin-right: 20rpx;
			}
		}
	}
</style>
